<?php

namespace App\Repositories;
use Illuminate\Support\Facades\Cache;
use App\Repositories\UserRepository;
class CachingUserRepository{
  protected $user;
  public function __construct(UserRepository $user){
    $this->user=$user;
  }

  public function find($id){
    return Cache::remember('user',60,function() use ($id){
      return $this->user->find($id);
    });

  }



}
